SELECT 
c.category_id categories_id,
c.parent_id,
c.sort_order,
d.language_id,
d.name categories_name, 
0 as TCGroupID

from 
<@PREFIX>category c join 
<@PREFIX>category_to_store cts on (c.category_id = cts.category_id) left join 
<@PREFIX>category_description d on (c.category_id = d.category_id) 

where 
cts.store_id = <@PROCESS@>@select trim(substring ( imp_extid from 7 for 200)) from 
 IMP_LINK b join imp_source_extra a on a.imp_sourceid = b.imp_sourceid and 
a.wshopid = b.Wgroupid  and a.imp_sourceid = <@SOURCEID@> ##
d.language_id = %s
